<!doctype html>
<html class="no-js">
<head>
<include file="Public:top"/>
</head>
<body>
<!--[if lte IE 9]><p class="browsehappy">升级你的浏览器吧！ <a href="http://se.360.cn/" target="_blank">升级浏览器</a>以获得更好的体验！</p><![endif]-->
</head>
<body>
<header class="am-topbar admin-header">
  <include file="Public:header"/>
</header>
<div class="am-cf admin-main"> 
<include file="Public:left"/>
<div class=" admin-content">	
		<div class="daohang">
			<ul>
				<li><button type="button" class="am-btn am-btn-default am-radius am-btn-xs"> 首页 </li>
			</ul>	
</div>
<div class="admin-biaogelist">
    <div class="listbiaoti am-cf">
      <ul class="am-icon-flag on"> 栏目名称</ul>   
      <dl class="am-icon-home" style="float: right;"> 当前位置： 首页 > <a href="#">商品列表</a></dl>   
      <dl>
        <a type="button" href="{:U('Admin/Add/add')}" class="am-btn am-btn-danger am-round am-btn-xs am-icon-plus"> 添加产品</a>
      </dl>    
    </div>
<!--   <div class="am-btn-toolbars am-btn-toolbar am-kg am-cf">
  <ul>
    <li>
      <div class="am-btn-group am-btn-group-xs">
        <select data-am-selected="{btnWidth: 90, btnSize: 'sm', btnStyle: 'default'}">
          <option value="b">产品分类</option>
          <option value="o">下架</option>
        </select>
      </div>
    </li>
    <li>
      <div class="am-btn-group am-btn-group-xs">
      <select data-am-selected="{btnWidth: 90, btnSize: 'sm', btnStyle: 'default'}">
        <option value="b">产品分类</option>
        <option value="o">下架</option>
      </select>
      </div>
    </li>
    <li style="margin-right: 0;">
      <span class="tubiao am-icon-calendar"></span>
      <input type="text" class="am-form-field am-input-sm am-input-zm  am-icon-calendar" placeholder="开始日期" data-am-datepicker="{theme: 'success',}"  readonly/>
    </li>
       <li style="margin-left: -4px;">
      <span class="tubiao am-icon-calendar"></span>
      <input type="text" class="am-form-field am-input-sm am-input-zm  am-icon-calendar" placeholder="开始日期" data-am-datepicker="{theme: 'success',}"  readonly/>
    </li>
        <li style="margin-left: -10px;">
      <div class="am-btn-group am-btn-group-xs">
      <select data-am-selected="{btnWidth: 90, btnSize: 'sm', btnStyle: 'default'}">
        <option value="b">产品分类</option>
        <option value="o">下架</option>
      </select>
      </div>
    </li>
    <li><input type="text" class="am-form-field am-input-sm am-input-xm" placeholder="关键词搜索" /></li>
    <li><button type="button" class="am-btn am-radius am-btn-xs am-btn-success" style="margin-top: -1px;">搜索</button></li>
  </ul>
</div> -->
    <form class="am-form am-g">
          <table width="100%" class="am-table am-table-bordered am-table-radius am-table-striped">
            <thead>
              <tr class="am-success">
                <th class="table-id">ID</th>
                <th class="table-title">商品名字</th>
                <th class="table-type">类别</th>
                <th class="table-author am-hide-sm-only">上架/下架 <i class="am-icon-check am-text-warning"></i> <i class="am-icon-close am-text-primary"></i></th>
                <th class="table-author am-hide-sm-only">商品主图片</th>
                <th class="table-date am-hide-sm-only">修改日期</th>
                <th width="163px" class="table-set">操作</th>
              </tr>
            </thead>
            <tbody>
            <foreach name="arr" item="v">
              <tr>
                <td>{$v.wares_id}</td>
                <td><a href="#">{$v.wares_name}</a></td>
                <td>{$v.wares_typename}</td>
                <if condition="$v.state eq 0">
                <td class="am-hide-sm-only"><i class="am-icon-check am-text-warning"></i></td>
                <else/>
                <td class="am-hide-sm-only"><i class="am-icon-close am-text-primary"></i></td>
                </if>
                <td class="am-hude-sm-only"><a href="{:U('Admin/Lookimg/lookimg')}?id={$v.wares_id}"><img src="__PUBLIC__/Uploads/{$v.wares_images}" alt="商品主图片" width="150px" height="80px"></a></td>
                <td class="am-hide-sm-only">{$v.wares_addtime}</td>
                <td><div class="am-btn-toolbar">
                    <div class="am-btn-group am-btn-group-xs">
                      <a href="{:U('Admin/Images/images')}?id={$v.wares_id}" class="am-btn am-btn-default am-btn-xs am-text-success am-round" title="添加产品分类图片"><span class="am-icon-search"></span> </a>
                      <a class="am-btn am-btn-default am-btn-xs am-text-secondary am-round" onclick="upd({$v['wares_id']},{$v['state']})" title="上下架"><span class="am-icon-pencil-square-o"></span></a>
                      
                      <a class="am-btn am-btn-default am-btn-xs am-text-danger am-round" title="删除" onclick="del({$v['wares_id']})"><span class="am-icon-trash-o"></span></a>
                    </div>
                  </div></td>
              </tr>
            </foreach>
            </tbody>
          </table>     
          <ul class="am-pagination am-fr">
                <li class="am-disabled"><a href="#">«</a></li>
                <li class="am-active"><a href="#">1</a></li>
                <li><a href="#">2</a></li>
                <li><a href="#">3</a></li>
                <li><a href="#">4</a></li>
                <li><a href="#">5</a></li>
                <li><a href="#">»</a></li>
          </ul>
          <hr />
          <p>注：.....</p>
        </form>
 <div class="foods">
   <include file='Public:footer'/>
</div>
</div>
</div>
</div>
<!--[if lt IE 9]>
<script src="http://libs.baidu.com/jquery/1.11.1/jquery.min.js"></script>
<script src="http://cdn.staticfile.org/modernizr/2.8.3/modernizr.js"></script>
<script src="assets/js/polyfill/rem.min.js"></script>
<script src="assets/js/polyfill/respond.min.js"></script>
<script src="assets/js/amazeui.legacy.js"></script>
<![endif]--> 
<!--[if (gte IE 9)|!(IE)]><!--> 
<script src="assets/js/amazeui.min.js"></script>
<!--<![endif]-->
<script type="text/javascript">
    function del(id){
    layui.use('layer', function () {
      var layer = layui.layer;
      layer.confirm('确定删除？',{icon:3,title:'删除'}, function (index) {
          $.get('list_del?wares_id='+id,function(data){
              if(data == 1){
                  layer.msg('删除成功!',{icon:6,time:500}, function () {
                      location.href = location.href;
                })
            }
        })

    })
})
}
    function upd(id,state){
    layui.use('layer', function () {
      var layer = layui.layer;
      layer.confirm('确定修改？',{icon:3,title:'修改'}, function (index) {
          $.get('list_upd?id='+id+'&state='+state,function(data){
              if(data == 1){
                  layer.msg('修改成功!',{icon:6,time:500}, function () {
                      location.href = location.href;
                })
            }
        })
    })
})
}

</script>
</body>
</html>